package com.laborder.sysyy.service.student.impl;

import com.laborder.sysyy.dao.StudentDaoMapper;
import com.laborder.sysyy.entity.Student;
import com.laborder.sysyy.service.student.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;

/**
 * @author 786107529@qq.com FJL
 * @Date 2018/9/10 11:51
 */
@Service
@Transactional
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDaoMapper studentDaoMapper;


    @Override
    public List<Student> findStudentWithPage(Map<String, Object> map) {
        return studentDaoMapper.findStudentWithPage(map);
    }

    @Override
    public int getStudentCount(Map<String, Object> map) {

        return studentDaoMapper.getStudentCount(map);
    }

    @Override
    public Student getStudentInfo(int sId) {

        return null;
    }
     /**
       * @function: 学生信息添加
       * @author: 759057893@qq.com lyz
       * @date: 2019/1/12 16:17
       */
    @Override
    public int saveStudentInfo(Student student) {

        return studentDaoMapper.saveStudentInfo(student);
    }
    
     /**
       * @function: 学生信息修改
       * @author: 759057893@qq.com lyz
       * @date: 2019/1/12 16:18
       */
    @Override
    public boolean updateStudentInfo(Student student) {
        if(studentDaoMapper.updateStudentInfo(student)!=0){
            return true;
        }else{
            return false;
        }
    }
    /**
     * @function:  删除学生信息
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/10 14:21
     */
    @Override
    public boolean delStudentInfo(int sId) {
        if(studentDaoMapper.delStudentInfo(sId)!=0)
            return true;
        return false;
    }
    /**
     * @function: 批量删除学生信息
     * @author: 759057893@qq.com lyz
     * @date: 2019/1/10 14:22
     */
    @Override
    public boolean delManyStudentInfo(int sId) {
        if(studentDaoMapper.delManyStudentInfo(sId)!=0)
            return true;
        return false;
    }

    @Override
    public Student getStudentInfoByName(String sClassNum) {

        return studentDaoMapper.getStudentInfoByName(sClassNum);
    }

    @Override
    public List<Student> getAllStudent() {

        return studentDaoMapper.getAllStudent();
    }

    @Override
    public Student selectStudentById(int sId) {

        return studentDaoMapper.selectStudentById(sId);
    }
}
